import { Code } from './code';
import { Flags } from './flags';
import buffer from '@ohos.buffer';

export interface newToken {
  version: number;
  serial?: string;
  digits?: number;
  createdAt?: Date;
  expiresAt?: Date;
  intervalInSeconds?: number;
  decryptedSeed?: buffer.Buffer;
  nonceDevIdHash: buffer.Buffer;
  nonceDevIdPassHash: buffer.Buffer;
  nonce: buffer.Buffer;
  encPayload: buffer.Buffer;
  mac: buffer.Buffer;
  flags: Flags;
  /**
   * Computes a code for this token
   * @param pin The pin to use to generate the code
   * @param date The instant to generate the token for
   * @returns Object containg code details
   */
  computeCode?: (pin?: string | number, date?: Date) => Code;
}